package com.sk.bilibili.model.fragment.search;

import com.sk.bilibili.model.BaseRefreshModel;
import com.sk.bilibili.other.JsonMap;
import com.sk.bilibili.view.fragment.search.BaseSearchFragment;

public abstract class BaseSearchModel<V extends BaseSearchFragment> extends BaseRefreshModel<V> {

    protected int page=1;
    protected int size=10;
    protected String keyword;

    protected JsonMap getJsonMap(){
        JsonMap map = new JsonMap();
        map.put("page",page);
        map.put("size",size);
        map.put("keyword",keyword);
        return map;
    }

    @Override
    public abstract void loadData();

    @Override
    public abstract void refreshData();

    public void refreshData(String keyword) {
        this.keyword=keyword;
        refreshData();
    }

}